/**
 * JAVACC DEMO 1.0
 * @copy right dwusoft company All rights reserved. 
 */
package com.apache.order.service.plugins;

import com.apache.api.manager.PluginConnector;
import com.apache.api.vo.ParamsVo;
import com.apache.order.entity.OrderLogMessage;
import com.apache.order.manager.OrderLogMessageManager;

/**
 * description:  订单引擎操作记录保存
 * @author Hou Dayu 创建时间：2015-8-14  
 */
public class LogMessageSavePluginImpl implements PluginConnector {

	private OrderLogMessageManager orderLogMessageManager;

	/**
	 * TODO 简单描述该方法的实现功能（可选）.  
	 * @see com.dwusoft.api.manager.PluginConnector#execute(com.dwusoft.api.vo.ParamsVo)  
	 */
	public Object execute(ParamsVo param) throws Exception {
		OrderLogMessage logMessage = new OrderLogMessage();
		logMessage.setObjId(String.valueOf(param.getParams("id")));
		logMessage.setUserEname(String.valueOf(param.getParams("userEname")));
		logMessage.setContent(String.valueOf(param.getParams("content")));
		logMessage.setCreatedTime(System.currentTimeMillis());
		logMessage.setLogType(String.valueOf(param.getParams("logType")));
		logMessage.setLogTitle(String.valueOf(param.getParams("logTitle")));
		logMessage.setReserved1(String.valueOf(param.getParams("reserved1")));
		logMessage.setReserved2(String.valueOf(param.getParams("reserved2")));
		ParamsVo vo = new ParamsVo();
		vo.setObj(logMessage);
		orderLogMessageManager.saveInfo(vo);
		return null;
	}

	public void setOrderLogMessageManager(OrderLogMessageManager orderLogMessageManager) {
		this.orderLogMessageManager = orderLogMessageManager;
	}

}
